package com.mcxx.modules.miniSalvation.order.param;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.TypeReference;
import lombok.Data;

import java.io.Serializable;
import java.util.List;
import java.util.Map;
import java.util.stream.Stream;

import static java.util.stream.Collectors.toList;


@Data
public class OrderBizStateParamNew implements Serializable {

    private String orderId;

    private String bizStateType;

    private Map<String, List<String>> curStep;

    private Map<String, String> nextBizState;

    public OrderBizStateParamNew(){}
    public OrderBizStateParamNew(String orderId, String bizStateType){
        this.orderId = orderId;
        this.bizStateType = bizStateType;
    }
    public void setCurStep(String curStep){
        this.curStep =  JSONObject.parseObject(curStep, new TypeReference<Map<String, List<String>>>(){});
    }
    public void setNextBizState(String nextStep){
        this.nextBizState = JSONObject.parseObject(nextStep, new TypeReference<Map<String, String>>(){});
    }


    public static void main(String[] args) {

        String str1 = "{\"1\":19}";
        System.out.println(str1);
        Map<String, String> jsonMap = JSONObject.parseObject(str1, new TypeReference<Map<String, String>>(){});
        for (String key : jsonMap.keySet()){
            System.out.println(key + "," + jsonMap.get(key));
        }

    }
}
